package team3.jobportal.businesslogic;

import team3.jobportal.controller.ApplicationController;
import team3.jobportal.database.DBManager;

public class Student {
	
	String userName=null;
	String password=null;
	boolean isLoginValid = true;
	String fName=null;
	String mName=null;
	String lName=null;
	
	String emailId=null;
	String secQn=null;
	String secAns = null;
	String error=null;
	
	String accountCreated= "false";
	
	public String getSecQn() {
		return secQn;
	}
	public void setSecQn(String secQn) {
		System.out.println("Sec qn is "+secQn);
		this.secQn = secQn;
	}
	public String getSecAns() {
		return secAns;
	}
	public void setSecAns(String secAns) {
		this.secAns = secAns;
	}

		
	public String getError() {
		return error;
	}
	public void setError(String error) {
		this.error = error;
	}
	
	public String getAccountCreated() {
	   accountCreated = createAccount();
		return accountCreated;
		//return accountCreated;
	}
	public void setAccountCreated(String accountCreated) {
		this.accountCreated = accountCreated;
	}
	
	
	public String getEmailId() {
		return emailId;
	}
	
	public void setEmailId(String emailId) {
		System.out.println("Setting email id to "+emailId);
		this.emailId = emailId;
	}
	public String getfName() {
		return fName;
	}
	public void setfName(String fName) {
		System.out.println("Setting fName id to "+fName);
		this.fName = fName;
	}
	public String getmName() {
		return mName;
	}
	public void setmName(String mName) {
		this.mName = mName;
	}
	public String getlName() {
		return lName;
	}
	public void setlName(String lName) {
		this.lName = lName;
	}
	public String getUserName() {
		//System.out.println("In student getusername :  "+userName);
		return userName;
	}
	public void setUserName(String userName) {
		//System.out.println("Setting username to "+userName);
		this.userName = userName;
	}
	public String getPassword() {
		//System.out.println("Pwd is "+password);
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
		
	}
	
		
	public String createAccount()
	{
		String result = "false";
		
		if((fName!=null) && (mName!=null))
		{
		//result = ApplicationController.getDBManager().createStudentAccount(fName+" "+mName+" "+lName, emailId, password, secQn, secAns);
		}
		else
		{
		
			result = "false";
		}
		if(result == "false")
		{
			error = "Could not create account";
		}
			return result;
			
	}
	
	

}
